package com.edu.app.service.impl.app.teacher;

import com.edu.app.bean.app.teacher.SysCustomerActFeedback;

import com.edu.app.mapper.app.teacher.SysCustomerActFeedbackMapper;
import com.edu.app.service.impl.SysBaseServiceImpl;
import com.edu.app.service.sys.app.teacher.SysCutomerActFeedbackService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysCutomerActFeedbackServiceImpl extends SysBaseServiceImpl<SysCustomerActFeedback, SysCustomerActFeedbackMapper> implements SysCutomerActFeedbackService {

    @Autowired
    SysCustomerActFeedbackMapper sysCustomerActFeedbackMapper;

    @Override
    public Integer getFeedbackIdWithCustomerAndActId(Integer customer_id, Integer activity_id){
        return sysCustomerActFeedbackMapper.getFeedbackIdWithCustomerAndActId(customer_id, activity_id);
    }

    @Override
    public PageInfo getObjectListOrderByTime(Integer id, Integer currentPage, Integer pageSize) {
        //设置分页信息，分别是当前页数和每页显示的总记录数【记住：必须在mapper接口中的方法执行之前设置该分页信息】
        PageHelper.startPage(currentPage, pageSize, true);
        List<SysCustomerActFeedback> list = sysCustomerActFeedbackMapper.getObjectListOrderByTime(id);

        PageInfo<SysCustomerActFeedback> pageInfo = new PageInfo<SysCustomerActFeedback>(list);
        return pageInfo;
    }

    @Override
    public Integer deleteCustomerActFeedbackByActId(Integer id){
        return sysCustomerActFeedbackMapper.deleteCustomerActFeedbackByActId(id);
    }
}
